package kjx_test_security.controller;

import kjx_test_security.auth.components.ResetAccessDeniedHandler;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;


@Slf4j
@RestController
@RequestMapping("/kjx")
@AllArgsConstructor
public class KjxController {



    @RequestMapping("/test")
    //@PreAuthorize("hasAnyAuthority('admin','test','system:dept:list')")
    public String test() throws Exception {


        return "你好吗";
    }


    @RequestMapping("/test2")
    @PreAuthorize("hasAuthority('aaa:list')")
    public String test2() throws Exception {


        return "你好吗";
    }


    @RequestMapping("/test3")
    @PreAuthorize("hasRole('admin')")
    public String test3() throws Exception {


        return "你好吗3333";
    }

}
